/*
 * Copyright 2002-2005 the original author or authors.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package lib.jsonrpc;

import java.util.Date;


/**
 * The Class Account used as parameter and return value in remote interface
 * 
 * @author jay liu
 * @since 07.10.2010
 */
@JSONObj
public class Account{
	
	/** The name. */
	@JSONProperty
	private String name;
	
	/** The id. */
	@JSONProperty
	private Long id;
	
	/** The age. */
	@JSONProperty
	private Integer age;
	
	/** The birthday. */
	@JSONProperty
	private Date birthday;
	
	/** The balance. */
	@JSONProperty
	private Double balance;
	
	/** The nick name. */
	@JSONProperty
	private String nickName;
	
	
		

	/**
	 * Gets the name.
	 *
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * Sets the name.
	 *
	 * @param name the new name
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * Gets the id.
	 *
	 * @return the id
	 */
	public Long getId() {
		return id;
	}

	/**
	 * Sets the id.
	 *
	 * @param id the new id
	 */
	public void setId(Long id) {
		this.id = id;
	}

	/**
	 * Gets the age.
	 *
	 * @return the age
	 */
	public Integer getAge() {
		return age;
	}

	/**
	 * Sets the age.
	 *
	 * @param age the new age
	 */
	public void setAge(Integer age) {
		this.age = age;
	}

	/**
	 * Gets the birthday.
	 *
	 * @return the birthday
	 */
	public Date getBirthday() {
		return birthday;
	}

	/**
	 * Sets the birthday.
	 *
	 * @param birthday the new birthday
	 */
	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	/**
	 * Gets the balance.
	 *
	 * @return the balance
	 */
	public Double getBalance() {
		return balance;
	}

	/**
	 * Sets the balance.
	 *
	 * @param balance the new balance
	 */
	public void setBalance(Double balance) {
		this.balance = balance;
	}

	/**
	 * Gets the nick name.
	 *
	 * @return the nick name
	 */
	public String getNickName() {
		return nickName;
	}

	/**
	 * Sets the nick name.
	 *
	 * @param nickName the new nick name
	 */
	public void setNickName(String nickName) {
		this.nickName = nickName;
	}
	
	
	/* (non-Javadoc)
	 * @see java.lang.Object#toString()
	 */
	public String toString(){
		StringBuffer sb = new StringBuffer();
		sb.append("Account:{");
		if (name != null)
			sb.append("name:" + name + ",");
		if (id != null)
			sb.append("id:" + id + ",");
		if (age != null)
			sb.append("age:" + age + ",");
		if (birthday != null)
			sb.append("birthday:" + birthday + ",");
		if (balance != null)
			sb.append("balance:" + balance + ",");
		if (nickName != null)
			sb.append("nickName:" + nickName);
		
		sb.append("}");
		
		return sb.toString();
		
	}

}
